
$.fn.Tips_attr=function(attrname,customcss,width,direction){ 
			
			var dirs;
			var X_offset;
			var Y_offset;
			if(attrname==undefined||attrname==''){
				attrname='alt';	
			}
			if(width==undefined||width==''){
				width='300';	
			}
			if(customcss==undefined||customcss==''){
				customcss='tips_orange';	
			}
			if(direction==undefined||direction==''){
				direction='bottom';	
				dirs='t';
			}
			if(direction=='bottom'){
				dirs='t';
				X_offset='-18';
				Y_offset='18';
			}else{
				X_offset='-18';
				Y_offset='-3';
				dirs='b';
			}
			
			var hiddenid='mumayiAttrHiddenDiv'+customcss;
	   		var defaults = {
				hiddenid:hiddenid,//隐藏层id
				attrs:attrname,//显示出属性的数据
				showtype:'fadeIn',//显示效果fadeIn("fast"),show()默认fadeIn("fast")自适应
				Xoffset:X_offset,//距离鼠标X值
				Yoffset:Y_offset,//距离鼠5标Y值
				index:'8888'//z-index
			};
		var opts =defaults;
		$('body').append('<div id="'+opts.hiddenid+'"><!--mumayi漂浮提示信息插件--></div>');
		var hiddenObject=$("#"+opts.hiddenid);
	
		hiddenObject.css({//给对象定义样式
				'position':'absolute',
				'overflow':'hidden',
				'display':'none',
				'z-index':opts.index
		});
		
		$(this).bind('mouseover',function(e){
			//清除原来的内容
			hiddenObject.html('');
			var data=$(this).attr(opts.attrs);
			
			
			var htmls='<div style="width:'+width+'px;" class="'+customcss+'"><div class="tips_left"><div class="tips_right"><p>'+data+'</p></div></div><div class="tips_bottom"><div class="tips_bottom_r"></div></div><div class="tips_arrow_'+dirs+'"></div></div>';
			hiddenObject.html(htmls);
			var left=e.pageX+parseInt(opts.Xoffset)+"px";
			var top =e.pageY+parseInt(opts.Yoffset)+"px";
			
			if(direction=='top'){
				var top =e.pageY-parseInt(hiddenObject.outerHeight())+parseInt(opts.Yoffset)+"px";
			}
		
		hiddenObject.css({//给返回的数据定义样式
						'position':'absolute',
						'overflow':'hidden',
						'top':top,
						'left':left,
						'z-index':opts.index
					}).fadeIn();//显示对象,fadeIn("fast")可以增加效果fadeIn("fast")

		}).bind('mousemove',function(e){
				var left=e.pageX+parseInt(opts.Xoffset)+"px";
				var top =e.pageY+parseInt(opts.Yoffset)+"px";
			
				if(direction=='top')
				{
					var top =e.pageY-parseInt(hiddenObject.outerHeight())+parseInt(opts.Yoffset)+"px";
				}
			
				hiddenObject.css({
					top:top,
					left:left
				});
			}).bind('mouseout',function(){
					
					hiddenObject.removeClass(customcss);
					hiddenObject.html('');
					hiddenObject.hide();//隐藏对象
			});
	 };  
	
	 
$.fn.Tips_html=function(htmlid,customcss,width,direction){ 
		var dirs;
		var X_offset;
		var Y_offset;
	    if(htmlid==undefined||htmlid=='')
		{
			alert('请在Tips_html插件内,定义漂浮提示ID参数!');
			return
		}
		if(direction==undefined||direction=='')
		{
			direction='bottom';	
			dirs='t';
		}
		if(width==undefined||width=='')
		{
			width='200';	
		}
		if(customcss==undefined||customcss=='')
		{
			customcss='tips_orange';	
		}
		if(direction==undefined||direction=='')
			{
				direction='bottom';	
				dirs='t';
			}
			if(direction=='bottom')
			{
				dirs='t';
				X_offset='-18';
				Y_offset='18';
			}else{
				X_offset='-18';
				Y_offset='-3';
				dirs='b';
		}
		var hiddenid='mumayiHtmlHiddenDiv'+customcss;
   		var defaults = {
			hiddenid:hiddenid,//隐藏层id
			showtype:'fadeIn',//显示效果fadeIn("fast"),show()默认fadeIn("fast")自适应
			Xoffset:'10',//距离鼠标X值
			Yoffset:'10',//距离鼠标Y值
			background: '#ccc',//显示层的背景
			padding:'5px',
			border:'1px solid #fff',
			index:'8888'//z-index
		};
		var opts =defaults;
		$('body').append('<div id="'+opts.hiddenid+'"><!--mumayi漂浮提示信息插件--></div>');
		var hiddenObject=$("#"+opts.hiddenid);
		hiddenObject.css({//给对象定义样式
				'position':'absolute',
				'overflow':'hidden',
				'display':'none',
				'z-index':opts.index
		});
		
		$(this).bind('mouseover',function(e){
			//清除原来的内容
			hiddenObject.html('');
			data=$("#"+htmlid).html();
			var htmls='<div style="width:'+width+'px;" class="'+customcss+'"><div class="tips_left"><div class="tips_right"><p>'+data+'</p></div></div><div class="tips_bottom"><div class="tips_bottom_r"></div></div><div class="tips_arrow_'+dirs+'"></div></div>';
			hiddenObject.html(htmls);
			var left=e.pageX+parseInt(opts.Xoffset)+"px";
			var top =e.pageY+parseInt(opts.Yoffset)+"px";
			if(direction=='top')
			{
				var top =e.pageY-parseInt(hiddenObject.outerHeight())+parseInt(opts.Yoffset)+"px";
			}
			hiddenObject.css({//给返回的数据定义样式
							'position':'absolute',
							'overflow':'hidden',
							'top':top,
							'left':left,
							'z-index':opts.index
						}).fadeIn();//显示对象,fadeIn("fast")可以增加效果fadeIn("fast")
			
					
		}).bind('mousemove',function(e){
				var left=e.pageX+parseInt(opts.Xoffset)+"px";
				var top =e.pageY+parseInt(opts.Yoffset)+"px";
				if(direction=='top')
				{
					var top =e.pageY-parseInt(hiddenObject.outerHeight())+parseInt(opts.Yoffset)+"px";
				}
				hiddenObject.css({
					top:top,
					left:left
				});
			}).bind('mouseout',function(){
					hiddenObject.removeClass(customcss);
					hiddenObject.html('');
					hiddenObject.hide();//隐藏对象
			});
};


$.fn.Tips_ajax=function(url,customcss,width,direction){ 
		
		var dirs;
		var X_offset;
		var Y_offset;
		if(direction==undefined||direction=='')
		{
			direction='bottom';	
			dirs='t';
		}
	    if(url==undefined||url=='')
		{
			alert('请在Tips_ajax插件内,定义漂浮提示Ajax Url参数信息!');
			return
		}
		if(width==undefined||width=='')
		{
			width='200';	
		}
		if(customcss==undefined||customcss=='')
		{
			customcss='tips_orange';	
		}
		if(direction==undefined||direction=='')
			{
				direction='bottom';	
				dirs='t';
			}
			if(direction=='bottom')
			{
				dirs='t';
				X_offset='-18';
				Y_offset='18';
			}else{
				X_offset='-18';
				Y_offset='-3';
				dirs='b';
		}
		var hiddenid='mumayiUrlHiddenDiv'+customcss;
   		var defaults = {
			hiddenid:hiddenid,//隐藏层id
			showtype:'fadeIn',//显示效果fadeIn("fast"),show()默认fadeIn("fast")自适应
			Xoffset:'10',//距离鼠标X值
			Yoffset:'10',//距离鼠标Y值
			background: '#ccc',//显示层的背景
			padding:'5px',
			border:'1px solid #fff',
			index:'8888'//z-index
		};
		var opts =defaults;
		$('body').append('<div id="'+opts.hiddenid+'"><!--mumayi漂浮提示信息插件--></div>');
		var hiddenObject=$("#"+opts.hiddenid);
		hiddenObject.css({//给对象定义样式
				'position':'absolute',
				'overflow':'hidden',
				'display':'none',
				'z-index':opts.index
		});
		
		$(this).bind('mouseover',function(e){
			//清除原来的内容
			hiddenObject.html('');
			var left=e.pageX+parseInt(opts.Xoffset)+"px";
			var top =e.pageY+parseInt(opts.Yoffset)+"px";
			if(direction=='top')
			{
				var top =e.pageY-parseInt(hiddenObject.outerHeight())+parseInt(opts.Yoffset)+"px";
			}
			$.get(url,{},function(data){
					var htmls='<div style="width:'+width+'px;" class="'+customcss+'"><div class="tips_left"><div class="tips_right"><p>'+data+'</p></div></div><div class="tips_bottom"><div class="tips_bottom_r"></div></div><div class="tips_arrow_'+dirs+'"></div></div>';
				hiddenObject.html(htmls);
			});
			

		hiddenObject.css({//给返回的数据定义样式
				'position':'absolute',
				'overflow':'hidden',
				'top':top,
				'left':left,
				'z-index':opts.index
			}).fadeIn();//显示对象,fadeIn("fast")可以增加效果fadeIn("fast")
			
		}).bind('mousemove',function(e){
				var left=e.pageX+parseInt(opts.Xoffset)+"px";
				var top =e.pageY+parseInt(opts.Yoffset)+"px";
				if(direction=='top')
				{
					var top =e.pageY-parseInt(hiddenObject.outerHeight())+parseInt(opts.Yoffset)+"px";
				}
				hiddenObject.css({
					top:top,
					left:left
				});
			}).bind('mouseout',function(){
					
					hiddenObject.removeClass(customcss);
					hiddenObject.html('');
					hiddenObject.hide();//隐藏对象
			});
};


$.fn.FloatImg=function(options) { 
		var defaults = {
			hiddenid:'mumayiHiddenImg',//隐藏层id
			thtml:'body',
			url:'',
			showtype:'fadeIn',//显示效果fadeIn("fast"),show()默认fadeIn("fast")自适应
			Xoffset:'10',//距离鼠标X值
			Yoffset:'10',//距离鼠标Y值
			background: '#ccc',//显示层的背景
			padding:'5px',
			border:'1px solid #fff',
			index:'888888888',//z-index
			width: '',//层的宽度.默认自适应
			height:''//层的高度.默认自适应
		};
		var opts = $.extend(defaults, options);
		
		$(opts.thtml).append('<div id="'+opts.hiddenid+'"><!--mumayi漂浮提示信息插件--></div>'); 
		var hiddenObject=$("#"+opts.hiddenid);
		hiddenObject.css({//给对象定义样式
				'position':'absolute',
				'overflow':'hidden',
				'display':'none',
				'z-index':opts.index
		});
		
		$(this).bind('mouseover',function(e){
			
			//清除原来的内容
			hiddenObject.html('');
			var left=e.pageX+parseInt(opts.Xoffset)+"px";
			var top =e.pageY+parseInt(opts.Yoffset)+"px";
			var data = $(this).val();
			
			var imgsrc = /^http[s]?\:\/\//i.test(data) ? data : (opts.url+data);
			imgsrc = imgsrc.replace(/\?[0-9\.]*$/,'') + '?' + Math.random(9);
			if(data!=''&&data!='嘉宾相片'){
				var imges;
				imges='<img src="'+imgsrc+'" title="图片预览" alt="图片预览"  />';
				hiddenObject.html(imges);
				
				hiddenObject.css({//给返回的数据定义样式
							'position':'absolute',
							'overflow':'hidden',
							'top':top,
							'left':left,
							'padding':opts.padding,
							'background':opts.background,
							'border':opts.border,
							'z-index':opts.index,
							'width':opts.width,
							'height':opts.height
						}).fadeIn();//显示对象,fadeIn("fast")可以增加效果fadeIn("fast")
			}
			}).bind('mousemove',function(e){
				var left=e.pageX+parseInt(opts.Xoffset)+"px";
				var top =e.pageY+parseInt(opts.Yoffset)+"px";
				hiddenObject.css({
					top:top,
					left:left
				});
			}).bind('mouseout',function(){
					hiddenObject.empty();
					hiddenObject.hide();//隐藏对象
			});
};